#ifndef CONFIG_H  // 防止重复包含
#define CONFIG_H

#include <string>  // 引入 std::string 的定义

// 子结构体定义
struct SaveFlag {
    bool save = false;        // 默认值为 false
    bool simpify = false;
    bool dense = false;
};

struct TimeInterval {
    int time_diff = 0;        // 默认值为 0
    int lidar_interval = 1000;
    int ai_interval = 1660;
    int ai_delay = 0;
};

struct CarConfig {
    double car_behind = 0.4;  // 默认值为 0.4
    double dwn_dis = 0.2;
    double lidar_attitude = -0.25;
    double lower_attitude = 0.25;
    double lidar_front = 0.8;
    double lidar_sides = 0.35;
};

struct DebugInfo {
    int debug_ai = 1;         // 默认值为 1
    int debug_lidar = 1;
    int debug_camdar = 1;
};

struct SaveSensor {
    int save_ai = 0;          // 默认值为 0
    int save_lidar = 0;
    int save_camdar = 1;
};

struct ModuleFunction {
    int function = 0;         // 默认值为 0
    int sensor = 0;
};

struct CamIntTri {
    double fx = 270.0;        // 默认值为 270.0
    double fy = 239.0;
    double cx = 329.0;
    double cy = 309.0;
    double x_cam = 0.485;
    double y_cam = 0.0;
    double z_cam = 0.0825;
    double rx = -105.0;
    double ry = 0.0;
    double rz = -90.0;
    int upper_pixel = 80;
    int lower_pixel = 110;
};

// 顶层结构体定义
struct Config {
    std::string name = "default_name";  // 默认值为 "default_name"
    double version = 1.0;              // 默认值为 1.0
    SaveFlag save_flag;
    TimeInterval time_interval;
    CarConfig car_config;
    DebugInfo debug_info;
    SaveSensor save_sensor;
    ModuleFunction module_function;
    CamIntTri cam_inttri;


    // 构造函数
    Config(const std::string& name = "default_name", double version = 1.0)
        : name(name), version(version) {}
};

#endif  // CONFIG_H
